using UnityEngine;
using Math;

namespace Terrain
{
    public class LevelData
    {
        public int NumLevels;
        public int MinLevel;
        public IVector2[] LevelPosPrevious;
        public IVector2[] LevelPosCurrent;
        public IVector2[] LevelOffset;
    }

    public class BlockData
    {
        public struct Block
        {
            /// <summary>
            /// convert from grid xy to world xy coordinates
            /// WorldPosAndScale.xy: origin of current block within world
            /// WorldPosAndScale.zw: grid spacing of current level
            /// </summary>
            public Vector4 WorldPosAndScale;

            /// <summary>
            /// compute coordinates for vertex texture
            /// TexturePosAndScale.xy: origin of block in texture
            /// TexturePosAndScale.zw: 1/(w, h) of texture
            /// </summary>
            public Vector4 TexturePosAndScale;
        }

        public int M;
        public int N;
        public int NumBlocksFinest;
        public int NumBlocksPerRing;
        public int BlockHeight;
        public IVector2[] BlockOrigin;
        public IVector2[] BlockOriginFinest;
        public Block[] Blocks;
        public int[] BlocksVisible;
        public int BlocksVisibleFinest;
    }
}